using UnityEngine;
using System.Collections;

public class ComponentTurn : MonoBehaviour
{
	[SerializeField]
	protected float RotateSpeed = 2.0f;
	
	// NOTE: The Ship prefab is locked to only rotating about the Z-axis (the X and Y axes are frozen).
	// Refer to the Rigidbody component on the Ship prefab: Constraints -> Freeze Rotation
	
	// Update is called once per frame
	void Update ()
	{
		// Rotate anti-clockwise
		if (Input.GetKey(KeyCode.LeftArrow))
		{
			transform.Rotate (0,0,RotateSpeed);
		}
		// Rotate clockwise
		else if (Input.GetKey(KeyCode.RightArrow))
		{
			transform.Rotate (0,0,-RotateSpeed);
		}
	}
}
